<?php

require('httpheader.php');
require('../install/mysqldb.php');
header('Content-Type:application/json; charset=utf-8');



if($_GET){
    $user = $_GET["user"];
}
if($cin){
    mysqli_select_db($cin,"hongbao");
    date_default_timezone_set('PRC');
    $userlist = mysqli_query($cin,"SELECT * FROM userinfo WHERE userid=$user");
    // var_dump($userlist);
    $data = array();
    if($userlist->num_rows){
        while($row = $userlist->fetch_row()){
            $result = detectionTime($row[6],$row[0],$cin);
            if(!$result){
                $createtime = date("H:i",$row[6]);
                $list = ["uid"=>$row[0],"text"=>$row[1],"datetime"=>$createtime];
                array_push($data,$list);
                $results = ["code"=>'200'];
            }
            
        }
        $results['data'] = $data;
    
    echo  json_encode($results);
    }
}

?>